/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.krossk.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Henrique
 */
@Entity
@Table(name = "repositorio", catalog = "krossk", schema = "")
@NamedQueries({
    @NamedQuery(name = "Repositorio.findAll", query = "SELECT r FROM Repositorio r"),
    @NamedQuery(name = "Repositorio.findByIdRepositorio", query = "SELECT r FROM Repositorio r WHERE r.idRepositorio = :idRepositorio")})
public class Repositorio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idRepositorio")
    private Integer idRepositorio;
    @Basic(optional = false,fetch=FetchType.LAZY)
    @Lob
    @Column(name = "conteudo")
    private byte[] conteudo;

    public Repositorio() {
    }

    public Repositorio(Integer idRepositorio) {
        this.idRepositorio = idRepositorio;
    }

    public Repositorio(Integer idRepositorio, byte[] conteudo) {
        this.idRepositorio = idRepositorio;
        this.conteudo = conteudo;
    }

    public Integer getIdRepositorio() {
        return idRepositorio;
    }

    public void setIdRepositorio(Integer idRepositorio) {
        this.idRepositorio = idRepositorio;
    }

    public byte[] getConteudo() {
        return conteudo;
    }

    public void setConteudo(byte[] conteudo) {
        this.conteudo = conteudo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRepositorio != null ? idRepositorio.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Repositorio)) {
            return false;
        }
        Repositorio other = (Repositorio) object;
        if ((this.idRepositorio == null && other.idRepositorio != null) || (this.idRepositorio != null && !this.idRepositorio.equals(other.idRepositorio))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.krossk.model.Repositorio[idRepositorio=" + idRepositorio + "]";
    }

}
